package com.wuseguang.springcloud.dao.repository;

import com.wuseguang.springcloud.entity.TeacherClassEvaluationItems;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;

public interface TeacherClassEvaluationItemsRepository extends JpaRepository<TeacherClassEvaluationItems, Integer> {

    //删除需要加 @Modifying @Transactional
    @Transactional
    @Modifying
    @Query(value = "DELETE FROM `teacher_class_evaluation_items` WHERE `class_id` = ?1 and teacher_id = ?2 and type = ?3",nativeQuery = true)
    int deleteByClassIdAndTecherId(Integer classId, String teacherId,Integer type);
}
